﻿@model IEnumerable<TaoNiuOA.Models.CheckingStrategy>
@{
    ViewBag.Title = "考勤策略";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<fieldset>
    <legend>考勤策略</legend>
    <p>
        @Html.ActionLink("添加", "Create")
    </p>
    <table>
        <tr>
            <th>
                类型
            </th>
            <th>
                绩效
            </th>
            <th>
                操作
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.GetApplyType().TypeName
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Point)
                </td>
                <td>
                    @Html.ActionLink("编辑", "Edit", new { id = item.CheckingStrategyID })
                    | <a href="javascript:delStrategy(@item.CheckingStrategyID)">删除</a>
                </td>
            </tr>
        }
    </table>
</fieldset>
<script type="text/javascript">
    function delStrategy(obj) {
        if (confirm("您确定要删除吗?")) {
            $.ajax({
                type: "post",
                url: "delete/" + obj,
                success: function (data) {
                    if (data == "删除成功")
                        window.location.reload();
                    alert(data);
                },
                error: function () {
                    alert("删除失败");
                }
            });
        }
    }
</script>
<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
